package com.weyoung.common.model.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;
import java.util.Map;

import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import lombok.Data;

/**
 * 家族文化活动表
 * @TableName family_culture
 */
@TableName(value ="family_culture")
@Data
public class FamilyCulture implements Serializable {
    /**
     * 文化活动主键ID，UUID格式
     */
    @TableId
    private String cultureId;

    /**
     * 关联的家族ID
     */
    private String familyId;

    /**
     * 创建者用户ID
     */
    private Integer creatorId;

    /**
     * 活动标题
     */
    private String title;

    /**
     * 活动简介
     */
    private String summary;

    /**
     * 活动详细内容(可包含HTML)
     */
    private String content;

    /**
     * 封面图片URL
     */
    private String coverImage;

    // 修改后（添加@TableField注解）
    @TableField(typeHandler = JacksonTypeHandler.class)
    private Object imageUrls;

    /**
     * 活动日期
     */
    private LocalDateTime activityDate;

    /**
     * 活动地点
     */
    private String location;

    @TableField(typeHandler = JacksonTypeHandler.class)
    private Object participants;

    /**
     * 浏览次数
     */
    private Long viewCount;

    /**
     * 状态:草稿/已发布/已归档
     */
    private Object status;

    /**
     * 创建时间
     */
    private LocalDateTime createTime;

    /**
     * 更新时间
     */
    private LocalDateTime updateTime;

    /**
     * 是否删除:0-未删除,1-已删除
     */
    private Object isDeleted;

    /**
     * 活动类型
     */
    private String activityType;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        FamilyCulture other = (FamilyCulture) that;
        return (this.getCultureId() == null ? other.getCultureId() == null : this.getCultureId().equals(other.getCultureId()))
            && (this.getFamilyId() == null ? other.getFamilyId() == null : this.getFamilyId().equals(other.getFamilyId()))
            && (this.getCreatorId() == null ? other.getCreatorId() == null : this.getCreatorId().equals(other.getCreatorId()))
            && (this.getTitle() == null ? other.getTitle() == null : this.getTitle().equals(other.getTitle()))
            && (this.getSummary() == null ? other.getSummary() == null : this.getSummary().equals(other.getSummary()))
            && (this.getContent() == null ? other.getContent() == null : this.getContent().equals(other.getContent()))
            && (this.getCoverImage() == null ? other.getCoverImage() == null : this.getCoverImage().equals(other.getCoverImage()))
            && (this.getImageUrls() == null ? other.getImageUrls() == null : this.getImageUrls().equals(other.getImageUrls()))
            && (this.getActivityDate() == null ? other.getActivityDate() == null : this.getActivityDate().equals(other.getActivityDate()))
            && (this.getLocation() == null ? other.getLocation() == null : this.getLocation().equals(other.getLocation()))
            && (this.getParticipants() == null ? other.getParticipants() == null : this.getParticipants().equals(other.getParticipants()))
            && (this.getViewCount() == null ? other.getViewCount() == null : this.getViewCount().equals(other.getViewCount()))
            && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
            && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
            && (this.getIsDeleted() == null ? other.getIsDeleted() == null : this.getIsDeleted().equals(other.getIsDeleted()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getCultureId() == null) ? 0 : getCultureId().hashCode());
        result = prime * result + ((getFamilyId() == null) ? 0 : getFamilyId().hashCode());
        result = prime * result + ((getCreatorId() == null) ? 0 : getCreatorId().hashCode());
        result = prime * result + ((getTitle() == null) ? 0 : getTitle().hashCode());
        result = prime * result + ((getSummary() == null) ? 0 : getSummary().hashCode());
        result = prime * result + ((getContent() == null) ? 0 : getContent().hashCode());
        result = prime * result + ((getCoverImage() == null) ? 0 : getCoverImage().hashCode());
        result = prime * result + ((getImageUrls() == null) ? 0 : getImageUrls().hashCode());
        result = prime * result + ((getActivityDate() == null) ? 0 : getActivityDate().hashCode());
        result = prime * result + ((getLocation() == null) ? 0 : getLocation().hashCode());
        result = prime * result + ((getParticipants() == null) ? 0 : getParticipants().hashCode());
        result = prime * result + ((getViewCount() == null) ? 0 : getViewCount().hashCode());
        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        result = prime * result + ((getIsDeleted() == null) ? 0 : getIsDeleted().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", cultureId=").append(cultureId);
        sb.append(", familyId=").append(familyId);
        sb.append(", creatorId=").append(creatorId);
        sb.append(", title=").append(title);
        sb.append(", summary=").append(summary);
        sb.append(", content=").append(content);
        sb.append(", coverImage=").append(coverImage);
        sb.append(", imageUrls=").append(imageUrls);
        sb.append(", activityDate=").append(activityDate);
        sb.append(", location=").append(location);
        sb.append(", participants=").append(participants);
        sb.append(", viewCount=").append(viewCount);
        sb.append(", status=").append(status);
        sb.append(", createTime=").append(createTime);
        sb.append(", updateTime=").append(updateTime);
        sb.append(", isDeleted=").append(isDeleted);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}